x86/HVM: fix preemption handling in do_hvm_op()
authorJan Beulich <jbeulich@suse.com>
Fri, 28 Mar 2014 12:31:23 +0000 (13:31 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 28 Mar 2014 12:31:23 +0000 (13:31 +0100)
commit8bad6c5626129ffba04dbab3a38115b6f3669596
tree43f09417f0660754e6f60d7556e3e8c4300d2140
parent8d134c2e12730a4a3dce9873f4671f6dd8860baf
x86/HVM: fix preemption handling in do_hvm_op()

Just like previously done for some mem-op hypercalls, undo preemption
using the interface structures (altering it in ways the caller may not
expect) and replace it by storing the continuation point in the high
bits of sub-operation argument.

This also changes the "nr" fields of struct xen_hvm_track_dirty_vram
(operation already limited to 1Gb worth of pages) and struct
xen_hvm_modified_memory to be only 32 bits wide, consistent with those
of struct xen_set_mem{type,access}. If that's not acceptable for some
reason, we'd need to shrink the HVMOP_op_bits (while still enforcing
the [then higher] limit resulting from the need to be able to encode
the continuation).

Whether (and if so how) to adjust xc_hvm_track_dirty_vram(),
xc_hvm_modified_memory(), xc_hvm_set_mem_type(), and
xc_hvm_set_mem_access() to reflect the 32-bit restriction on "nr" is
unclear: If the APIs need to remain stable, all four functions should
probably check that there was no truncation. Preferably their
parameters would be changed to uint32_t or unsigned int, though.

As a minor cleanup, along with introducing the switch-wide "pfn" the
redundant "d" is also being converted to a switch-wide one.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/hvm.c
xen/include/public/hvm/hvm_op.h